<?php
/**
 * Created by PhpStorm.
 * User: leo
 * Date: 2018/5/14
 * Time: 12:15
 */
session_start();
include '../classes/conn.php';

$num=$_POST['num'];
$psw=$_POST['psw'];
$query="select num,psw from admin where num='{$num}' and psw='{$psw}'";
$res=mysql_query($query);
if(mysql_num_rows($res)){
    $_SESSION['admin_num']=$num;
    echo 1;
}
else echo '0';
mysql_close($conn);